package AcWing周赛;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: a
 * Date: 2022-09-03
 * Time: 19:03
 */
public class Demo67_1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int T = scanner.nextInt();
        while(T-- > 0){
            int n = scanner.nextInt();
            if(n % 2 == 0){
                String res = new String();
                n /= 2;
                while(n-- > 0){
                    res += "1";
                }
                System.out.println(res);
            }else{
                n /= 2;
                String res = new String();
                res += "7";
                n--;
                while(n-- > 0){
                    res += "1";
                }
                System.out.println(res);
            }
        }
    }
}
